<?php

/**
 * 验证码处理
 */
namespace Api\Controller;
use Think\Controller;
class PostsController extends Controller {

    //登录验证
    function lists(){
    	    	
    	$posts_model=M("Posts");       	
		//dump($mobile);		
		$data = $posts_model->order('post_date desc')->select();
		if(!empty($data)){            
                //$_SESSION["user"]=$result;
                //写入此次登录信息                
                $this->ajaxReturn($data,'json');           
        }	
    }
	
	//登录验证
    function postread(){
    	$pid = $_POST['id'];
		//dump($pid);
    	$posts_model = M("Posts");       	
		//dump($mobile);		
		$postinfo = $posts_model->where(array('id' => $pid))->find();
		$postinfo[post_content] = strip_tags($postinfo[post_content]);
		//dump($postinfo);
	
		//$postinfo = htmlspecialchars_decode($postinfo);
		//dump($postglh);
		if(!empty($postinfo)){            
                //$_SESSION["user"]=$result;
                //写入此次登录信息                
                $this->ajaxReturn($postinfo,'json');           
        }	
    }
}

